#include <bits/stdc++.h>
using namespace std;

// 生成随机数
mt19937 rnd(time(0));

// 生成[l,r]范围内的随机整数
long long randInt(long long l, long long r) {
    return l + rnd() % (r - l + 1);
}

// 生成n个不同的随机数
vector<long long> genDifferentNumbers(int n, bool positive = false) {
    set<long long> used;
    vector<long long> result;
    while(result.size() < n) {
        long long val;
        if(positive) {
            val = randInt(1, 1e8);
        } else {
            val = randInt(-1e8, 1e8);
        }
        if(used.count(val)) continue;
        used.insert(val);
        result.push_back(val);
    }
    return result;
}

// 生成单个测试数据文件
void genOneTest(int testId, string folder = "data", string prefix = "sequence") {
    string filename = folder + "\\" + prefix + to_string(testId) + ".in";
    freopen(filename.c_str(), "w", stdout);
    
    // 生成T组数据
    int T = randInt(1, 5);
    cout << T << "\n";
    
    while(T--) {
        int n;
        // 根据测试点编号决定数据规模和特性
        if(testId <= 4) {
            n = randInt(5, 10);
        } else if(testId <= 8) {
            n = randInt(15, 20);
        } else {
            n = randInt(25, 30);
        }
        
        cout << n << "\n";
        
        // 特殊性质A: 所有数字都是正数
        vector<long long> arr;
        if(testId >= 5 && testId <= 8) {
            arr = genDifferentNumbers(n, true);
        } else {
            arr = genDifferentNumbers(n);
        }
        
        // 输出数组
        for(int i = 0; i < n; i++) {
            cout << arr[i] << " \n"[i == n-1];
        }
    }
}

int main() {
    // 生成样例数据
    // 样例1：小数据
    string filename = "sample\\sequence1.in";
    freopen(filename.c_str(), "w", stdout);
    cout << "1\n4\n1 2 3 4\n";
    
    // 样例2：包含负数的数据
    filename = "sample\\sequence2.in";
    freopen(filename.c_str(), "w", stdout);
    cout << "1\n5\n1 -1 2 3 -3\n";
    
    // 样例3：大规模数据
    filename = "sample\\sequence3.in";
    freopen(filename.c_str(), "w", stdout);
    cout << "1\n30\n";
    vector<long long> arr = genDifferentNumbers(30);
    for(int i = 0; i < 30; i++) {
        cout << arr[i] << " \n"[i == 29];
    }
    
    // 生成测试数据
    for(int i = 1; i <= 20; i++) {
        genOneTest(i);
    }
    
    return 0;
}
